<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 浅复制/深复制
      // 001 = ["a", "b", "c"]
      // const arr = [1, "001", 2, 3];
      const arr = [1, ["a", "b", "c"], 2, 3];
      const newArr = [...arr]; // [1, "001", 2, 3];

      newArr[1][0] = "X";
      console.log(arr);
    </script>
  </body>
</html>
